/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author machine
 */
@Entity
@Table(name = "seriespeliculas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Seriespeliculas.findAll", query = "SELECT s FROM Seriespeliculas s"),
    @NamedQuery(name = "Seriespeliculas.findByIdseriespeliculas", query = "SELECT s FROM Seriespeliculas s WHERE s.idseriespeliculas = :idseriespeliculas")})
public class Seriespeliculas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idseriespeliculas")
    private Integer idseriespeliculas;
    @JoinColumn(name = "idpeliculas", referencedColumnName = "idpeliculas")
    @ManyToOne(optional = false)
    private Peliculas idpeliculas;
    @JoinColumn(name = "idseries", referencedColumnName = "idseries")
    @ManyToOne(optional = false)
    private Series idseries;

    public Seriespeliculas() {
    }

    public Seriespeliculas(Integer idseriespeliculas) {
        this.idseriespeliculas = idseriespeliculas;
    }

    public Integer getIdseriespeliculas() {
        return idseriespeliculas;
    }

    public void setIdseriespeliculas(Integer idseriespeliculas) {
        this.idseriespeliculas = idseriespeliculas;
    }

    public Peliculas getIdpeliculas() {
        return idpeliculas;
    }

    public void setIdpeliculas(Peliculas idpeliculas) {
        this.idpeliculas = idpeliculas;
    }

    public Series getIdseries() {
        return idseries;
    }

    public void setIdseries(Series idseries) {
        this.idseries = idseries;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idseriespeliculas != null ? idseriespeliculas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Seriespeliculas)) {
            return false;
        }
        Seriespeliculas other = (Seriespeliculas) object;
        if ((this.idseriespeliculas == null && other.idseriespeliculas != null) || (this.idseriespeliculas != null && !this.idseriespeliculas.equals(other.idseriespeliculas))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beans.Seriespeliculas[ idseriespeliculas=" + idseriespeliculas + " ]";
    }
    
}
